// 批量引入，基于webpack的require.context方法，参考 https://webpack.js.org/guides/dependency-management/#requirecontext
// require.context(
//   directory,
//   (useSubdirectories = true),
//   (regExp = /^\.\/.*$/),
//   (mode = 'sync')
// )
const ComponentsMap = {}
function importAll(r) {
  r.keys().forEach(key => {
    // key的值 ./1-1.vue  ./1-2-1.vue
    const _key = `example-${key.slice(2, key.length - 4)}`
    ComponentsMap[_key] = r(key).default
  });
}
importAll(require.context(
  './components',
  false,
  /\.vue$/
))
export default ComponentsMap
